﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using SZSLSystem.Model;
using SZSLSystem.DAL;

namespace SZSLSystem.BLL
{
    /// <summary>
    /// 业务逻辑层：组织机构
    /// </summary>
    public partial class Organization
    {
        private readonly SZSLSystem.DAL.Organization dal = new DAL.Organization();

        public Organization()
        {

        }

        #region  Method

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(Guid Id)
        {
            return dal.Exists(Id);
        }

        /// <summary>
        /// 返回数据总数(分页用到)
        /// </summary>
        public int GetCount(string strWhere)
        {
            return dal.GetCount(strWhere);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(SZSLSystem.Model.Organization model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(SZSLSystem.Model.Organization model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除该栏目分类及所有属下分类数据
        /// </summary>
        public bool Delete(Guid Id)
        {
            return dal.Delete(Id);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SZSLSystem.Model.Organization GetModel(Guid Id)
        {
            return dal.GetModel(Id);
        }

        /// <summary>
        /// 得到所有商品类别
        /// </summary>
        /// <returns></returns>
        public DataTable GetList(Guid ParID)
        {
            return dal.GetList(ParID);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public SZSLSystem.Model.Organization GetParentModel(Guid Id)
        {
            return dal.GetParentModel(Id);
        }

        public DataTable GetList(string fileName, string strWhere, string typeID)
        {
            return dal.GetList(fileName, strWhere, typeID);
        }

         /// <summary>
        /// 获得管理员查询分页数据
        /// </summary>
        /// <param name="pageSize">每页数目</param>
        /// <param name="currentPage">当前页数</param>
        /// <param name="strWhere">查询条件</param>
        /// <param name="filedOrder">排序条件</param>
        /// <returns></returns>
        public DataSet GetPageList(int pageSize, int currentPage, string strWhere, string filedOrder)
        {
            return dal.GetPageList(pageSize, currentPage, strWhere, filedOrder);
        }

        #endregion  Method
    }
}
